package com.angel.domain.angeluser.valueobjects;

import lombok.Getter;

/*
 * 更新关注微信公众号： 为了offer
 * @author parkin
 * @description 微信信息
 * @date 2021/11/13
 */
@Getter
public class WeChatInfo {
    private String nickName;
    private String openId;
    private String avatarUrl;

    private WeChatInfo() {}

    /**
     * 将所有参数对象化，可以防止传错参数
     * @param weChatNickName
     * @param weChatOpenId
     * @param weChatAvatarUrl
     * @return
     */
    public static WeChatInfo create(WeChatNickName weChatNickName,
                             WeChatOpenId weChatOpenId,
                             WeChatAvatarUrl weChatAvatarUrl) {

        WeChatInfo weChatInfo = new WeChatInfo();
        weChatInfo.avatarUrl = weChatAvatarUrl.getAvatarUrl();
        weChatInfo.openId = weChatOpenId.getOpenId();
        weChatInfo.nickName = weChatNickName.getNickName();
        return weChatInfo;
    }
}
